package com.qububu.play.common.dto;

import java.util.Arrays;

public class ActionTalkoverDto {

	private String talkId;
	private String content;
	private int time;
	private String authorId;
	private String authorName;
	private String actionId;
	
	private Type type;
	
	public Type getType() {
		return type;
	}

	public void setType(Type type) {
		this.type = type;
	}

	public String getActionId() {
		return actionId;
	}
	
	public void setActionId(String actionId) {
		this.actionId = actionId;
	}
	public String getTalkId() {
		return talkId;
	}
	public void setTalkId(String talkId) {
		this.talkId = talkId;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	
	public int getTime() {
		return time;
	}
	public void setTime(int time) {
		this.time = time;
	}
	public String getAuthorId() {
		return authorId;
	}
	public void setAuthorId(String authorId) {
		this.authorId = authorId;
	}
	public String getAuthorName() {
		return authorName;
	}
	public void setAuthorName(String authorName) {
		this.authorName = authorName;
	}
	
	/**
	 * 聊天内容所属的类型(“聚餐”, "运动", "pk菜", “吐槽”)中的一种
	 * */
	public enum Type {
		SPORT(0),
		DINE(1),
		BLAST(2),//吐槽
		SHOW(3);
		
		private int intValue;
		
		private Type(int intValue) {
			this.intValue = intValue;
		}
		
		/**
		 * 根据传入字符串来返回对应的状态类型
		 */
		public static Type getType(String strValue) {
			try {
				Type type = valueOf(strValue);
				return type;
			}
			catch(Exception ex) {
				throw new IllegalArgumentException("Value '" + strValue + "' is not allowed in StapleFood. Only "
						+ Arrays.toString(Type.values()) + " are allowed."
						);
			}
		}
		
		public static Type getType(int intValue) {
			for (Type elem : Type.values()) {
				if (elem.toIntValue() == intValue) {
					return elem;
				}
			}

			throw new IllegalArgumentException("Value '" + intValue
					+ "' is not allowed in Type.");
		}
		
		public int toIntValue() {
			return intValue;
		}
	}
	
	/**
	 * @功能 id加密
	 *//*
	public ActionTalkoverDto(String talkId, String authorId){
		this.talkId = talkId;
		this.authorId = authorId;
	}
	public ActionTalkoverDto(long talkId, long authorId){
		this.talkId = SystemUtil.encrypt(String.valueOf(talkId));
		this.authorId = SystemUtil.encrypt(String.valueOf(authorId));
	}*/
}
